Method for enhancing compressibility and visual quality of scanned document images

ABSTRACT

A system and method of image processing for smoothing, denoising, despeckling and sharpening scanned document images which is performed prior to a compression. The scanned image is selectively smoothed by anisotropic diffusion filtering in a single iteration with a 3×3 kernel, which provides denoising, edge-preserving smoothing. The smoothed image data is then selectively sharpened using variable contrast mapping that provides overshoot-free variable-sharpening and despeckling. Image quality is improved while increasing compressibility of the image.

FIELD OF THE INVENTION

The present invention relates to processing of image data and inparticular to enhancing quality and compressibility of digit imagesincluding combinations of text, graphics, and natural images byselective smoothing/denoising and selective sharpening.

BACKGROUND OF THE INVENTION

Digital image data is often processed to enhance the visual quality ofthe image. Common image processing techniques include image smoothingand image sharpening. Smoothing is a technique that is mainly performedfor reducing certain types of noise. Non-selective (or linear) smoothingalgorithms smooth all features in an image (i.e., areas in the imagewhich can be characterized as flat regions and areas within the imagewhich can be characterized as edges). However, it is undesirable tosmooth edges since smoothed edges gives the image a “blurry” appearance.Moreover, although smoothing is effective in removing most Gaussiannoise, it is less effective in removing high amplitude noise such asspeckle noise. Speckle noise can be characterized as a singleunintentional black dot in a white region or a single unintentionalwhite dot in a black region.

Generally, sharpening is a technique in which the edges within the imageare sharpened to improve the visual quality of an image. This techniqueis often performed to enhance the visual quality of text or graphicswithin an image. One disadvantage of non-selective sharpening techniquesis that they also tend to amplify noise.

Selective (or non-linear) filters such as selective smoothing orselective sharpening filters overcome the disadvantages of non-selectivefilters by applying the filtering function only to the features that areto be smoothed/sharpened while preserving the non-selected features.Selective filters include some means of identifying or differentiatingbetween features, so that the filter is applied only to the desiredfeature. One example of an edge preserving, selective smoothing filteris an anisotropic diffusion filter.

Due to its denoising nature, the anisotropic diffusion filteringtechnique has recently been considered for enhancing compressibility.Specifically, an anisotropic diffusion filter was iteratively applied toimage data between 10 and 20 times to obtain an optimal ratio between avisual quality measure and the bit-per-pixel (bpp) compression rate. Itwas found that applying 5 iterations produced images that wereperceptually equivalent to the original images and the compressionbit-rate was improved by 5%-17.5%. Although this technique shows thatanisotropic diffusion can be used to improve image compressibility, itis impractical for real-time image processing applications such as imagescanning since many time consuming iterations are required to obtain thedesired image quality and compressibility. In addition, the conventionalanisotropic diffusion technique does not clean speckle noise and othertypes of high amplitude noise and is thus insufficient forpre-processing scanned document images.

Another denoising/smoothing filtering technique that has been suggestedfor compression enhancement applications is a Sigma-filter that is evenmore computationally expensive per iteration than anisotropic diffusionfiltering (although it requires less iterations for achieving the samenoise reduction). However, this technique is still not fast enough forapplications for processing full-page images or real-time imageprocessing. Like the anisotropic diffusion filter, the Sigma-filter alsodoes not remove high amplitude noise.

Finally, in the case of both denoising techniques (i.e., anisotropicdiffusion filtering and Sigma pre-processing) each was considered forprocessing only natural images. However, application of these techniqueson document images-containing text, graphics, and natural images was notconsidered since it is well known that denoising filters (particularlyapplied in many iterations) degrade the quality of textual and graphicalimages. Specifically, edge sharpness of text features is degraded.

What is needed is an image processing technique which can be applied tocombination-type (i.e., text, graphical, natural) document images andwhich increases compressibility while enhancing image quality with lowcomputational complexity for real-time applications.

SUMMARY OF THE INVENTION

A system and method of enhancing image data and increasingcompressibility of data by selectively smoothing the image data whilepreserving edges and selectively sharpening image data using variablecontrast stretching. In one embodiment, variable contrast stretching isperformed by clipping those pixel intensity values outside of a variablerange and mapping those pixel intensity values within the variablerange. In another embodiment, selective smoothing is performed using arobust anistotropic diffusion (RAD) filter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a first embodiment of the image processing method ofthe present invention;

FIG. 2 illustrates an embodiment of the variable contrast stretchingfunction;

FIG. 3 illustrates a 3×3 hollow neighborhood;

FIG. 4 illustrates a second embodiment of the image processing method ofthe present invention;

FIG. 5 illustrates a technique of applying the method shown in FIG. 4 toimage data;

FIG. 6 illustrates another technique of applying the method shown inFIG. 4 to image data;

FIG. 7 illustrates an embodiment of the system of image processing ofthe present invention.

DETAILED DESCRIPTION OF THE INVENTION

In general, the present invention is an image processing method andsystem for performing both selective image smoothing/denoising andselective image sharpening using variable contrast stretching such thatwhen performing selective image smoothing, areas within the imagecharacterized as flat regions are smoothed/denoised while areas withinthe image characterized as edges are essentially preserved and whenperforming selective image sharpening using variable contraststretching, edges within the image are sharpened without canceling outthe smoothing/denoising effects on the flat regions obtained duringselective smoothing and also without introducing overshoot noise atedges. Variable contrast stretching is performed by dynamically clippingpixel values which, besides sharpening, is also effective in removingspeckle noise that is not removed during selective smoothing.

The combination of denoising (i.e., noise removing) obtained fromselective smoothing and despeckling (i.e., speckle removing) obtainedfrom selective sharpening results in significant noise reduction.Reducing image noise allows for increased compressibility. Hence, thesystem and method of image processing of the present invention isparticularly adaptable to pre-processing image data prior to compressionso as to enhance image compressibility while maintaining or improvingimage quality. For example, in one compression method based on abit-plane representation which applies lossless compression to atruncated set of bit planes as described in the application entitled“Method Including Lossless Compression of Luminance Channel and LossyCompression of Chrominance Channels” (Attorney Docket No. 100061:87-1)filed Sep. 29, 2000 and assigned to the assignee of the presentinvention, the compression ratio is increased in a range ofapproximately 30-50%.

Since selective sharpening according to the present invention retainssmoothing/denoising effects from the selective smoothing, the image canbe initially oversmoothed during selective smoothing to obtain increaseddenoising and then selectively sharpened to re-sharpen edges that mighthave been affected by the smoothing algorithm thereby providingsignificant denoising capability.

The system and method of the present invention requires minimalcomputation steps since a single iteration of each of selectivesmoothing and sharpening techniques achieves acceptable image qualityand compressibility.

FIG. 1 shows a first generalized embodiment of the method of the presentinvention in which selective smoothing is performed using any edgepreserving image smoothing/denoising technique (10) and selectivelysharpening is performed on the selectively smoothed image data usingvariable contrast stretching (11). As shown, input image data I iscoupled to the input of the selective smoothing stage which generatesselectively smoothed image data I′ wherein areas within the imagecharacterized as flat regions are smoothed/denoised and areas within theimage characterized as edges are essentially preserved. The selectivelysmoothed data I′ as well as the original image data I is coupled to theselective sharpening stage. The smoothed image data I′ is sharpeneddependent on dynamic contrast information obtained from original imagedata I wherein edges are sharpened such that denoising benefits obtainedwhile smoothing are unaffected. In one embodiment, the method of imageprocessing is performed in a single iteration.

Edge-preserving image smoothing/denoising techniques can be performed byanisotropic-type diffusion filtering, non-linear smoothing/denoisingfiltering, bilateral-type filtering, Sigma filtering, order statisticsfiltering such as median filtering, or any other type of edge preservingsmoothing filter. In one type of edge-preserving smoothing filter, pixeldata corresponding to edges within the image data are identified and thesmoothing filter function is applied to flat regions and is not appliedto the identified edges. In general, linear smoothing is an operationwhere the pixel value is replaced by a weighted average of itsneighbors. This attenuates high frequency components, namely abruptchanges in pixel intensity. It should be understood that the degree ofedge preserving obtained when selectively smoothing is, in part,dependent on the reliability/robustness of how edges are differentiatedfrom flat regions by the edge preserving smoothing filter and thestrength of the smoothing filter. As a result, some edges may incur somesmoothing.

Selective sharpening is performed using variable contrast stretching.Selective sharpening using variable contrast stretching is described inan application entitled “Image Sharpening by Variable ContrastStretching” (Attorney Docket No. 10006310-1) filed Sep. 29. 2000 andassigned to the assignee of the present invention. Variable contraststretching reduces spatial scale of large gray-level transitions,resulting in considerable sharpening of features in computer-generatedimages (e.g., text, CAD drawings). The variable contrast stretching onlymildly reduces the spatial scale of milder gray-level transitions,resulting in a milder sharpening of features in “natural” images (e.g.,photographed features, features captured by an image capture device).Thus, the variable contrast stretching applies strong sharpening tocomputer-generated features and mild sharpening to edges in naturalfeatures. The variable contrast stretching improves the appearance adlegibility of compound documents containing both natural andcomputer-generated features. However, the variable contrast stretchingdoes not change the spatial scale for weak gray-level transitions, andthus, does not amplify low amplitude noise.

One of the advantages of the first embodiment of the method of imageprocessing shown in FIG. 1 is that the step of selectively smoothing iseffective in removing most noise types including Gaussian-type noise butis ineffective in removing speckle-type noise (e.g., white dots on blackor black dots on white) since speckles often appear as edges toselective smoothing filters, while the selective sharpening step usingvariable contrast stretching is effective in removing the speckle-typenoise. As a result, the system and method of image processing removes asignificant amount of noise from the image.

Removal of noise from image data allows for increased compressibility ofthe image-data. Accordingly, one application of the image processingmethod of the present invention is the pre-processing of image dataaccording to the methods shown in FIGS. 1 and 4 prior to compressing theimage data.

It should be noted that the effectiveness of the noise removal isdependent on what type of selective smoothing is performed as well ashow the variable contrast stretching is adjusted for filtering certaintypes of image data. Hence, the increased compressibility is dependenton how effectively noise is removed when selectively smoothing andselectively sharpening using variable contrast stretching.

Variable Contrast Stretching

Selective sharpening of smoothed digital image data using variablecontrast stretching is performed as follows. The smoothed digital imageI′ is made up of a plurality of selectively smoothed pixels P′. Eachselectively smoothed pixel P′ corresponds to an original pre-smoothedpixel P having the same location within the digital image. A point-wisecontrast stretching operation g(*) is performed on each selectivelysmoothed pixel of interest P₀′ as follows in Eq. 1: $\begin{matrix}{{g( P_{0}^{\prime} )} = ( \begin{matrix}{{P_{0}^{\prime} - A} \leq {- W}} & m \\{{{P_{0}^{\prime} - A}} < W} & {A + {\frac{D}{2W}( {P_{0}^{\prime} - A} )}} \\{{P_{0}^{\prime} - A} \geq W} & M\end{matrix} } & ( {{Eq}.\quad 1} )\end{matrix}$

FIG. 2 illustrates the graphical representation of the variable contraststretching function g(P₀′). The pixel of interest P₀′ is filtered withrespect to a neighborhood of pixels. The neighborhood of pixelscorresponds to the hollow (i.e., missing center pixel) neighborhood ofthe pre-smoothed pixels with respect to the pre-smoothed pixel ofinterest P₀. FIG. 3 illustrates an example of a hollow neighborhood ofpre-smoothed pixels. The hollow neighborhood, delineated by a windowindicated in dashed lines, includes a 3×3 array of pixels minus a centerpixel. The center pixel block designated by an “X”, corresponds to thesmoothed pixel of interest P₀′ to be operated on by the sharpeningalgorithm.

Since the pre-smoothed neighborhood is used, edges are sharpeneddependent on pre-smoothed image dynamic contrast information resultingin more reliable edge sharpening. The maximum gray-value of theneighborhood is denoted by the uppercase letter M, and minimumgray-value of the neighborhood is denoted by the lowercase letter m. Thelocal dynamic range of the neighborhood, denoted by the letter D, is thedifference between minimum and maximum values of the neighborhood (i.e.,D=M−m). If, for example, the pixel intensity values are represented by8-bit words, the lowest intensity value of the pixels in theneighborhood is m=5 and the highest intensity value of the pixels in theneighborhood is M=250, the dynamic range is D=245 for that neighborhood.

A “contrast range” has a width of 2W. The contrast range is centeredabout the middle (A) of the dynamic range, A=(M+m)/2. Thus, the contrastrange has a starting point at A−W and an ending point at A+W.

If the intensity value of the pixel of interest P₀′ is outside of thecontrast range, the intensity value is clipped to either m or M. If theintensity value of the pixel of interest lies within the contrast range,the amount by which the local contrast is changed is determined by thegradient of the slope of a line segment 10 (FIG. 2) within the contrastrange.

The slope of the line segment 10 is a function of the dynamic range. Ingeneral, the slope, denoted by S(D), complies with the following:

-   -   the slope approaches unity as the dynamic range D approaches 0        (i.e., S→1 as D→0);    -   the slope is greater than unity when the dynamic range is        greater than zero (i.e., S>1 when D≠0); and    -   the slope is a non-decreasing function of the dynamic range        (i.e., as the dynamic range increases, the slope becomes larger        and the sharpening increases).

Thus the slope is a function of the dynamic range and the contrast rangeof a given pixel neighborhood. Because a neighborhood is determined foreach pixel, the dynamic range, contrast range and the slope are varibleon a pixel-by-pixel basis.

There are many different ways of expressing the slope of the linesegment 10 (FIG. 2). For example, the slope may be expressed as followsin Eq. 2: $\begin{matrix}{{S(D)} = {\frac{D}{2W} = {1 + \frac{D}{R}}}} & ( {{Eq}.\quad 2} )\end{matrix}$

where constant R is a single global parameter that corresponds to thedynamic scale for sharpening. Thus, the variable contrast stretchingoperation within the variable contrast range may be expressed as followsin Eq. 3. $\begin{matrix}{{g( P_{0}^{\prime} )} = {P_{0}^{\prime} + {\frac{D}{R}( {P_{0}^{\prime} - A} )\quad\{ {{{P_{0}^{\prime} - A}} < W} \}}}} & ( {{Eq}.\quad 3} )\end{matrix}$

If D>>R, the mapping becomes equivalent to toggle mapping, whereby edgesare over-sharpened. Proper selection of the constant R prevents such aproblem. For neighborhoods having small dynamic ranges, D<<R and1+D/R≈1. Therefore, no effective change in contrast will occur for D<<R.

The constant R may be limited to powers of two for computationalefficiency. Since the quantity 1+D/R involves a division by the constantR, limiting the constant R to a power of two allows the division to beperformed simply by bit-shifting. Thus, R=2^(L), where integer L>0. Asthe constant R decreases, the sharpening effect increases since thecontrast region 2W is smaller and the slope S(D) of the contraststretching becomes larger.

For pixel intensity values that are represented by 8-bit words, thepreferred value of R is between 64 and 512 (i.e., 6≦L≦9). Moregenerally, if the dynamic range of the entire image is normalized tocover the complete dynamic range of the capturing device (e.g.,scanner), the preferred value of R is between one-quarter of the dynamicrange and twice the dynamic range.

It should be noted that variable contrast stretching also avoidsovershoot. Thus, over-shoot related artifacts do not appear as theresult of interpolation of digital images that have been sharpened byvariable contrast stretching.

Variable contrast stretching does not enhance low-amplitude noise, andin some cases can slightly reduce low-amplitude noise. Because thevariable contrast stretching does not increase low-amplitude noise andit avoids overshoot, compressibility of the sharpened image is notreduced. Consequently, a digital image may be sharpened only once, priorto compression, thus avoiding the need to sharpen the image each timeafter decompression.

The variable contrast stretching is not limited to linear mapping withinthe contrast range. Although linear mapping is preferred, non-linearmapping within the contrast range may be performed.

FIG. 4 shows a second embodiment of the method of image processing inwhich image data is initially selectively smoothed (12) using an edgepreserving filtering technique known as Robust-Anisotropic-Diffusion(RAD) filtering and then smoothed data is selectively sharpened usingvariable contrast stretching (13).

The RAD filter is a type of filter that performs selective smoothing bysimulating a diffusion process on the image where the diffusivitydepends locally on the strength of a feature type, i.e., an edge. Theselectivity mechanism is based on robust statistics and in particular toan influence function Ψ of a robust error-norm. In this embodiment, RADfiltering is applied in a single iteration to a 3×3 neighborhood (i.e.,kernel) of each pixel of interest P₀ in the input image data I togenerate a smoothed pixel P₀′.

For each pixel of interest, P₀ the following RAD filtering equation (Eq.4) is applied: $\begin{matrix}{P_{0}^{\prime} = {P_{0} + {( {\Delta\quad t} ){\sum\limits_{j = 1}^{B}{C_{j}{\psi( {{P_{j} - P_{0}},T} )}}}}}} & ( {{Eq}.\quad 4} )\end{matrix}$

-   -   where P_(j) is one of the neighbors in the hollow 3×3        neighborhood, Ψ is the influence-function of a robust        error-norm, T is a characteristic scale of Ψ, the C_(j) are        spatial weights, and Δt is an arbitrary time step for the        diffusion filter. In this embodiment, the arbitrary time step Δt        relates to a heat diffusion model parameter and is set to Δt=1        so as to provide adequate filter denoising and simplified        computation. Other values of Δt may be selected. The parameter        C_(j) provides a spatial weighting. In one embodiment, the C_(j)        factors correspond to a 3×3 binomial filter which is set as        follows: $C_{j} = \{ \begin{matrix}        \frac{1}{4} & {j = 0} \\        \frac{1}{8} & {{j = 2},4,5,7} \\        \frac{1}{16} & {{j = 1},3,6,8}        \end{matrix} $        where subscript j corresponds to the pixel location within the        3×3 neighborhood (shown in FIG. 3) including the center pixel of        interest P₀ (not shown in FIG. 3).

The influence function Ψ corresponds to a photometric weighting functionand, in this embodiment, is given by:${\psi( {{\Delta\quad P},T} )} = \{ \begin{matrix}{{\Delta\quad P} \geq T} & T \\{{{\Delta\quad P}} < T} & {\Delta\quad P} \\{{\Delta\quad P} \leq {- T}} & {- T}\end{matrix} $

wherein ΔP is P_(j)−P₀. The above influence function is selected so asto provide a good trade-off betwen denoising efficiency and imagequality. In one embodiment, the preferred characteristic scale isselected as T-32 in the case in which the input image is a documentimage including text, graphics, and natural images.

It should be noted that other influence functions may be used to performRAD image filtering. Specific influence functions determine the degreeof smoothing dependent on the pixel of interest and its neighborhoodtype. Hence, different functions may be chosen dependent on the type ofinput image data.

The smoothed image data is selectively sharpened (13, FIG. 4) usingvariable contrast stretching as described above. Specifically, the inputto the selectively sharpening filter is the output of the RAD filter,(i.e., the selectively smoothed image data, I′). The selectivelysmoothed image data is then selectively sharpened on a pixel-by-pixelbasis.

Two parameters, T and R, used in the method of image processing as shownin FIG. 4 provide significant control over the amount of smoothing andsharpening obtained from the method and hence, also influence both imagequality and compressibility. These values can be empirically selected soas to obtain the best compressibility while maintaining acceptable imagequality which is, in turn, dependent on the type of image (i.e.,natural, graphical, textual, or a combination of these image types)being processed.

For instance, as R is increased, image sharpening decreases andcompression ratio slightly increases until it reaches a maximum value.So R may be set so as to obtain the most desirable visual sharpness andthe most acceptable compression ratio. Similarly, as T increases so doesthe compression ratio, however, so does image blurring. Hence, T may beset so as to obtain the most desirable visual smoothness with the mostacceptable compression ratio. It was found that setting T=32 and R=128yielded acceptable visual quality and significantly increasedcompressibility for document images including text compressed accordingto the compression method as described in the application entitled“Method Including Lossless Compression of Luminance Channel and LossyCompression of Chrominance Channels” (Attorney Docket No. 10006187-1)filed Sep. 29, 2000 and assigned to the assignee of the presentinvention.

In one embodiment, the selective smoothing and selective sharpening ofthe method of FIG. 4 can be combined into a single in-linedpixel-by-pixel process. By combining the pixel processing steps ofselective smoothing and selective sharpening, computation time isminimized by reducing the number of times data elements (intensityvalues, contrast values, etc) are accessed and processed. FIG. 5 showsone technique of applyng the method shown in FIG. 4 in a single in-lineprocess where image data is smoothed and then, sharpened on apixel-by-pixel basis.

A digital image I_(in) is accessed or received (block 102). The digitalimage may be accessed from a digital image file, the digital image maybe received one or more lines at a time and processed in real time, etc.

For each pixel of interest P₀ (block 104, 120, 122) from digital imagedata I_(in), a neighborhood of pixels is determined (block 106), aninfluence function value Ψ is determined for each pixel with respect toeach pixel j in the neighborhood (block 108), a weighting value C_(j) isdetermined for each pixel in the neighborhood (block 110), and the RADfilter function (Eq. 4) is applied to the pixel of interest P₀ (block112) to generate a smoothed pixel of interest P₀′. Next, the hollowneighborhood of pixels is determined (block 114), a dynamic range andcontrast range of the hollow neighborhood are determined (block 116),and the contrast stretching operation g(P₀′) is applied to the pixel ofinterest P₀′ (block 118) to generate a smoothed and sharpened pixelvalue P₀″. Pixels lying at the boundaries of the digital image will havepartial neighborhoods. These boundary pixels may be processed withrespect to their partial neighborhoods, or the filtering may be ignoredand the boundary pixels may be stored without modification. Aftersmoothing and sharpening each pixel, the resulting digital image dataI_(out) may be compressed (block 124). In the case in which theneighborhood size and geometry is the same for each of the smoothing andsharpening processing steps, then the step of determining theneighborhood for the nth pixel (block 106) and the step of determiningthe hollow neighborhood for the nth pixel (block 114) can be performedin a single step by block 106.

FIG. 6 shows an alternative embodiment for applying the method as shownin FIG. 4 to a digital image in which image data I is smoothed togenerate smoothed data I′ and then the smoothed image data I′ issharpened to generate processed data I″. A digital image is received(block 202), and for each pixel of interest (block, 204, 214, 216) fromdigital image data I, a neighborhood of pixels is determined (block206), an influence function value Ψ is determined for each pixel withrespect to each pixel j in the neighborhood (block 208), a weightingvalue C_(j) is determined for each pixel in the neighborhood (block210), and the RAD filter function (Eq. 4) is applied to the pixel ofinterest P₀ (block 212) to generate smoothed digital image data I′.

For each smoothed pixel of interest (block 218, 226, 228) in thesmoothed digital image data I′, the hollow neighborhood of pixels isdetermined (block 220), a dynamic range and contrast range of the hollowneighborhood are determined (block 222), and the contrast stretchingoperation g(P₀′) is applied to the pixel of interest P₀′ (block 224).After the sharpening filter has been applied to the digital image, thesharpened image may be compressed (block 230).

The system for performing the method of image processing shown in FIGS.1 and 4 may be implemented in hardware software or a combination of thetwo. In one embodiment, the system may be implemented in two stages: afirst stage for performing selective smoothing and a second stage forperforming selective sharpening using variable contrast stretching. FIG.7, shows one implementation of a system for performing the method ofimage processing according to FIGS. 1 and 4 including selectivesmoothing stage 14 coupled to selective sharpening stage 15. An inputdevice 16 such as a scanner or digital camera provides image data I tothe selective smoothing stage 14 which processes the image data andprovides smoothed data I′ to the selective sharpening stage 15 togenerate the processed image data I″. In this embodiment, stages 14 and15 may be implemented as hardware, software, or a combination of thetwo. In an alternative embodiment, stages 14 and 15 are implemented by aprocessing system including a processor and a memory. In thisimplementation, the processor processes the image data received from aninput device by performing the steps as shown in FIGS. 1 and 4 accordingto programming instructions.

It should be noted that although a 3×3 square-shaped neighborhood isused when performing both selective image smoothing and sharpening, thesystem and method of image processing according to the present inventionis not limited to such a neighborhood. The neighborhood is not limitedto any particular size. The number of pixels is not limited to nine.Although a fixed number of pixels in the neighborhood is preferred forall pixels of interest, the size of the neighborhood may be changeddynamically to accommodate a particular class of image region (e.g.,text, graphics, natural features).

The neighborhood is not limited to any particular geometry, althoughsquare windows are preferred for performance regions. For example, theshape of the neighborhood may be diamond shaped. In addition, theneighborhood for each of the selective smoothing filtering operation andthe selective sharpening operation need not be the same size.

Although the method of image processing can provide acceptableenhancement and increased compressibility in a singleiteration/application of the method to the image data, it should beunderstood that the method of image processing can be performed inmultiple iterations on the image data.

The methods of image processing shown in FIGS. 1 and 4 are not limitedto documents including both text and natural images. However, it isparticularly adaptive to image enhancement and compressibility oftextual images or combinations of textual images, with graphics andnatural images.

Although the method and system of image processing has been described inconnection with grayscale values, it is not so limited. The imageprocessing technique may be applied to color images, for example, imagesin RGB color space. In this case, the color image is transformed into ahuman visual system color space such as YCbCr color space. Selectivesmoothing and selective sharpening is then applied only to the luminancechannel (Y) and the resulting color image can be compressed either inthe YCbCr color space or in the RGB color space. If it is compressed inthe YCbCr color space, the transformation from YCbCr back to RGB isavoided.

In the preceding description, numerous specific details are set forth,such as specific parameter values or influence functions in order toprovide a through understanding of the present invention. It will beapparent, however, to one skilled in the art that these specific detailsneed not be employed to practice the present invention. In otherinstances, well-known filtering operations have not been described indetail in order to avoid unnecessarily obscuring the present invention.

In addition, although elements of the present invention have beendescribed in conjunction with certain embodiments, it is appreciatedthat the invention can be implement in a variety of other ways.Consequently, it is to be understood that the particular embodimentsshown and described by way of illustration is in no way intended to beconsidered limiting. Reference to the details of these embodiments isnot intended to limit the scope of the claims which themselves recitedonly those features regarded as essential to the invention.

1. A method of processing image data including pixel intensity valuescomprising the steps of: selectively smoothing the image data togenerate selectively smoothed image data wherein areas characterized asedges within the selectively smoothed image data are essentiallypreserved; selectively sharpening the selectively smoothed image datausing variable contrast stretching.
 2. The method as described in claim1 wherein variable contrast stretching is performed by: clipping thosepixel intensity values outside of a variable range; and mapping thosepixel intensity values within the variable range.
 3. The method asdescribed in claim 1 wherein the step of selectively smoothing isperformed using robust anisotropic diffusion (RAD) filtering.